package com.appspot.mypartymanager.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.persistence.OneToMany;


@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Party implements Serializable {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;

	@Persistent
	private Date dateCreated;

	@Persistent
	private String ownerUserGoogleAcount;

	@Persistent
	private String name;

	@Persistent
	private String announcement;

	@Persistent
	private Date partyDate;

	@Persistent
	private List<String> partyManagersGoogleAcounts;

	@Persistent
	private String googleMapsAdress;

	@Persistent
	private String adress;

	@Persistent
	@OneToMany
	private List<Gift> wishList;

	@Persistent
	@OneToMany
	private List<Guest> guestlist;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getDateCreated() {
		return dateCreated;
	}

	public void setDateCreated(Date dateCreated) {
		this.dateCreated = dateCreated;
	}

	public String getOwnerGoogleAcount() {
		return ownerUserGoogleAcount;
	}

	public void setOwnerGoogleAcount(String ownerGoogleAcount) {
		this.ownerUserGoogleAcount = ownerGoogleAcount;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAnnouncement() {
		return announcement;
	}

	public void setAnnouncement(String announcement) {
		this.announcement = announcement;
	}

	public Date getPartyDate() {
		return partyDate;
	}

	public void setPartyDate(Date partyDate) {
		this.partyDate = partyDate;
	}

	public List<String> getPartyManagersGoogleAcounts() {
		return partyManagersGoogleAcounts;
	}

	public void setPartyManagersGoogleAcounts(
			List<String> partyManagersGoogleAcounts) {
		this.partyManagersGoogleAcounts = partyManagersGoogleAcounts;
	}

	public String getGoogleMapsAdress() {
		return googleMapsAdress;
	}

	public void setGoogleMapsAdress(String googleMapsAdress) {
		this.googleMapsAdress = googleMapsAdress;
	}

	public String getAdress() {
		return adress;
	}

	public void setAdress(String adress) {
		this.adress = adress;
	}

	public List<Gift> getWishList() {
		return wishList;
	}

	public void setWishList(List<Gift> wishList) {
		this.wishList = wishList;
	}

	public List<Guest> getGuestlist() {
		return guestlist;
	}

	public void setGuestlist(List<Guest> guestlist) {
		this.guestlist = guestlist;
	}
	
	
	@SuppressWarnings("unused")
	public Party() {
	}

	/**
	 * @param dateCreated
	 * @param ownerGoogleAcount
	 * @param name
	 * @param announcement
	 * @param partyDate
	 * @param partyManagersGoogleAcounts
	 * @param googleMapsAdress
	 * @param adress
	 */
	public Party(Date dateCreated, String ownerGoogleAcount, String name,
			String announcement, Date partyDate,
			List<String> partyManagersGoogleAcounts, String googleMapsAdress,
			String adress) {
		super();
		this.dateCreated = new Date();
		this.ownerUserGoogleAcount = ownerGoogleAcount;
		this.name = name;
		this.announcement = announcement;
		this.partyDate = partyDate;
		this.partyManagersGoogleAcounts = partyManagersGoogleAcounts;
		this.googleMapsAdress = googleMapsAdress;
		this.adress = adress;
		this.wishList = new ArrayList<Gift>();
		this.guestlist = new ArrayList<Guest>();
	}

	@Override
	public String toString() {
		return "Party [id=" + id + ", dateCreated=" + dateCreated
				+ ", ownerUserGoogleAcount=" + ownerUserGoogleAcount
				+ ", name=" + name + ", announcement=" + announcement
				+ ", partyDate=" + partyDate + ", partyManagersGoogleAcounts="
				+ partyManagersGoogleAcounts + ", googleMapsAdress="
				+ googleMapsAdress + ", adress=" + adress + ", wishList="
				+ wishList + ", guestlist=" + guestlist + "]";
	}

}
